package com.bawei.database.entity

import androidx.room.TypeConverter
import com.blankj.utilcode.util.GsonUtils

/**
 * Author: Jason Zhang
 * Date: 2025/4/25
 * Desc: 数据库字段转换操作
 */
class CustomTypeConverters {

    @TypeConverter
    fun arrayListToString(list: ArrayList<String>): String{
        return GsonUtils.toJson(list)
    }

    fun stringToArrayList(json: String): ArrayList<String>{
        return GsonUtils.fromJson(json, ArrayList::class.java) as ArrayList<String>
    }


}